<template>
	<view class="navbar" :style="{textAlign:textAlign}">
		<image src="/static/index_slices/back_left.png" mode="" @click="toBack" v-if="isBack"></image>
		<text>{{title}}</text>
	</view>
</template>

<script setup>
	const props = defineProps({
		isBack:{
			type:Boolean,
			default:false
		},
		textAlign:{
			type:String,
			default:'center'
		},
		title:{
			type:String,
			default:'积分交易'
		},
	})
	// 返回上一页
	const toBack = ()=>{
		uni.navigateBack({
		  delta: 1 // 返回层数（默认1，表示返回上一页）
		});
	}
</script>

<style lang="scss" scoped>
	.navbar{
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		height: 280rpx;
		background-color: #FF413B;
		border-radius: 0 0 46rpx 46rpx;
		color: #fff;
		padding: 90rpx 0 0 0;
		box-sizing: border-box;
		text-align: center;
		z-index: 1;
		image{
				position: absolute;
				left: 30rpx;
				top: 90rpx;
				width: 20rpx;
				height: 38rpx;
		}
	}
</style>